package com.example.foo;

public enum UserLevelEnum {

	L_2_0("2-0", "会员"),
	L_2_1741("2-1741", "经理"),
	L_2_1742("2-1742", "经销商")
	;

	public final String levelId;// 等级ID
	public final String levelName;// 等级名称

	UserLevelEnum(String levelId, String levelName) {
		this.levelId = levelId;
		this.levelName = levelName;
	}

	public static UserLevelEnum ofLevelId(String levelId) {
		for (UserLevelEnum e : UserLevelEnum.values()) {
			if (e.levelId.equals(levelId)) {
				return e;
			}
		}
		throw new IllegalStateException("Unknown levelId: " + levelId);
	}

}
